part of 'widget.dart';

class _AppFooterWloc extends StatelessWloc<AppFooter> {
  late final AppFooterBloc _bloc;

   String get telegramIconAssetPath => 'assets/telegram_grey_icon.svg';

  void onLinkPressed({
    required String href,
  }) {
    if (href == _Hrefs.supportEmail) {
      _bloc.openEmailApp();
    } else if (href == _Hrefs.faqPage) {
      _bloc.openFaqPage();
    } else if (href == _Hrefs.termsOfUse) {
      _bloc.openTermsOfUse();
    } else if (href == _Hrefs.privacyPolicy) {
      _bloc.openPrivacyPolicy();
    }else if (href == _Hrefs.documentationPage) {
      _bloc.openDocumentationPage();
    }
  }

  void onTelegramButtonPressed() {
    _bloc.openTelegramChannel();
  }

  @override
  void initState() {
    super.initState();
    _bloc = AppFooterBloc(
      appNavigatorBloc: core_di.sl(),
      urlLauncherBloc: core_di.sl(),
    );
  }

  @override
  void dispose() {
    _bloc.close();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return _AppFooterView(
      wloc: this,
    );
  }
}
